<script type="text/javascript">

</script>

<div id="page_content">
    <?php if (!isset($this->formdata)) { ?>
    <h2><?php echo $this->t->_("New form") ?></h2>
    <?php } else { ?>
    <h2><?php echo $this->formdata['title'] ?></h2>

    <div id="pages_list">
    <ul>
    <?php
    foreach ($this->fields as $key => $value) {
        if ($value->required) $required = '<span class="required">*</span>'; else $required = '';
        if ($value->visible) $class='bold'; else $class='';
        echo '<li><div class="i_field i_mod0"><a href="'.ADMIN_URL.'/forms/field/fid/'.$value->fid.'/id/'.$value->id.'" class="'.$class.'">'.$value->position.'. '.$value->title.' ('.$this->t->_($value->type).' / '.$value->field.') '.$required.'</a>&nbsp;</div></li>';

    }
    ?>
    </ul>
    </div>

    <?php } echo $this->form ?>
</div>

<div id="sidebar">
    <?php if (isset($this->formdata)) { ?>
    <a href="<?php echo ADMIN_URL.'/forms/field/fid/'.$this->formdata['id'] ?>" class="sidebar_button add_button"><?php echo $this->t->_("New field") ?></a><br />
    <a href="#" id="<?php echo ADMIN_URL.'/forms/delete/id/'.$this->formdata['id'] ?>" class="sidebar_button delete_button"><?php echo $this->t->_("Delete form") ?></a>
    <?php } ?>
</div>

